package com.alex;

import com.alex.config.SpringConfig;
import com.alex.controller.ManageController;
import com.alex.dao.EmployeeDao;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class Application {

    private static final Logger logger = LoggerFactory.getLogger(Application.class);

    public static void main(String[] args) {
//        ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("beans.xml");
        AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(SpringConfig.class);
        ManageController mc = ctx.getBean("manageController", ManageController.class);
        mc.execute();

        EmployeeDao employeeDao = ctx.getBean("employeeDao", EmployeeDao.class);
        employeeDao.showCount();

        logger.info("hello alex");
    }
}
